<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String basePath = "http://" + request.getLocalAddr() + ":"
			+ request.getLocalPort() + request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<title>${promptInfo.totalDescInfo}</title>

<head>
<script type="text/javascript">
$(document).ready(function(){
	$("#selectMenu").selectTB({	
		//传值元素ID
		valElementID:'select_default_value',	
		//显示元素ID
		textElementID:'select_default_text',	
		selectWidth:'198',
		selectHeight:'16',		
		primkeyColumn:'orgID',
		//树根描述
		rootName:'', 
		//要进行树型显示的列，支持一列
		selectShowColumn:'orgName',
		//树型下拉树列表，起始根值
		nodeStartValue:'${session.s_userOrgID}', 
		//描述树形菜单子列
		childNodeColumn:'orgID',
		//描述树形菜单父列
		parentNodeColumn:'orgParentID',	
    	//ajax 获取所有树json格式信息
    	ajax:{
			//ajax请求url
			url:'ajaxAction.action', 
			//ajax请求参数
			data:'code=${pmsIndex.sys_org_mgr.code}'
		}
	},{
		animated:false
    }); 
	
	$.formValidator.initConfig({formid:"actionForm",onerror:function(){alert("校验没有通过，具体错误请看错误提示")}}); 
	$("#select_default_value").formValidator({onshow:"请选择机构",onfocus:"请选择机构",oncorrect:"谢谢您的配合"}).inputValidator({min:1,onerror:"机构不能为空,请确认"});
	$("#name").formValidator({onshow:"请输入姓名",onfocus:"请输入您的真实姓名",oncorrect:"谢谢您的配合"}).inputValidator({min:1,onerror:"姓名不能为空,请确认"});
	//需要什么正则表达式可以在formValidatorRegex.js里面自己写
	$("#loginID").formValidator({onshow:"请输入用户名",onfocus:"用户名至少4个字符,最多15个字符",oncorrect:"恭喜你,该用户名可用"}).inputValidator({min:4,max:15,onerror:"用户名的长度不正确"}).regexValidator({regexp:"username",datatype:"enum",onerror:"用户名格式不正确"}).ajaxValidator({
		//ajax验证
		type : "get",
		url : "ajaxAction.action",
		datatype : "json",
		data: "code=${pmsIndex.sys_check_account.code}",//不用传loginID的值，已经在formValidator.js中自动传值了
		success : function(jsonData){//[JSON]{"data":null,"paginatedData":null,"singleData":0}
			if( jsonData.singleData == "0" )
			{
                return true;
			}
            else
			{
                return false;
			}
		},
		buttons: $("#button"),
		error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
		onerror : "该用户名已存在，请更换用户名",
		onwait : "正在对用户名进行合法性校验，请稍候..."
	});
	$("#password").formValidator({onshow:"请输入密码",onfocus:"密码由6-15位的字母或数字组成",oncorrect:"密码合法"}).inputValidator({min:6,max:15,empty:{leftempty:false,rightempty:false,emptyerror:"密码两边不能有空符号"},onerror:"密码的长度不正确"}).regexValidator({regexp:"password",datatype:"enum",onerror:"密码格式不正确"});
	$("#confirmPwd").formValidator({onshow:"请输入重复密码",onfocus:"两次密码必须一致",oncorrect:"密码一致"}).inputValidator({min:6,max:15,empty:{leftempty:false,rightempty:false,emptyerror:"重复密码两边不能有空符号"},onerror:"重复密码的长度不正确"}).compareValidator({desid:"password",operateor:"=",onerror:"两次密码不一致,请确认"});
	$("#mobilePhone").formValidator({onshow:"请输入移动电话",onfocus:"移动电话不能为空",oncorrect:"恭喜你,你输对了"}).inputValidator({min:1,onerror:"移动电话不能为空"}).regexValidator({regexp:"mobile",datatype:"enum",onerror:"你输入的移动电话不符合规范"});
	$("#officePhone").formValidator({onshow:"请输入办公电话",onfocus:"办公电话不能为空",oncorrect:"恭喜你,你输对了"}).inputValidator({min:1,onerror:"办公电话不能为空"}).regexValidator({regexp:"tel",datatype:"enum",onerror:"你输入的办公电话不符合规范"});
	$("#email").formValidator({onshow:"请输入邮箱地址",onfocus:"邮箱地址不能为空",oncorrect:"恭喜你,你输对了"}).inputValidator({min:1,onerror:"邮箱地址不能为空"}).regexValidator({regexp:"email",datatype:"enum",onerror:"你输入的邮箱不符合规范"});

	$("#password").passStrength({ 
		shortPass: "top_shortPass", 
		badPass: "top_badPass", 
		goodPass: "top_goodPass", 
		strongPass: "top_strongPass", 
		userid: "#loginID"
	}); 
});
</script>
</head>
<body >
<form name="actionForm" method="post" action="operateAction.action" id="actionForm">
<input type="hidden" value="name" name="logColumn" /> 
<input type="hidden" value="true" name="islog" /> 
<input type="hidden" name="code" value="${code}"> 
<input type="hidden" name="imitateStep" value="${pmsIndex.sys_user_mgr.imitationStep}"> 
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableC">
	<tr>
		<td class="tableCleft">&nbsp;</td>
		<td class="tableCcenter">
		<table width="100%" border="0" cellpadding="0" cellspacing="1" class="SkyTDLine">
			<tr>
				<td class="SkyTDLine">
				<table class="SkyTDLine" cellSpacing="1" cellPadding="0" width="100%" border="0">
					<tr class="MeNewTDLine" align="center">
						<td align="center">
						<table class="Ntable" cellSpacing="1" cellPadding="0" width="100%" border="0">
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine" width="10%">所属机构：</td>
								<td  class="SkyTDLine"> 
									<table border="0" cellpadding="0" cellspacing="0">
										<tr>	
											<td align="left" width="199">
                                                  <div id="selectMenu">
										      <input type="hidden"  id="select_default_value" name="paramMap.select_org_id">
                                      		      <input type="hidden" id="select_default_text">
									         </div>
                                                  </td>
											<td>&nbsp;<font color="red">*<span id="inputOrgCode"></span></font><span id="select_default_valueTip" style="width:250px"></span></td>
									</tr>
								</table>
								</td>
							</tr>
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine" width="10%">用户姓名：</td>
								<td class="SkyTDLine"><input name="paramMap.name" type="text" maxlength="20" id="name" style="width: 200;" />&nbsp;<font color="red">*</font><span id="nameTip" style="width:250px"></span></td>
							</tr>
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine" width="10%">用户帐号：</td>
								<td class="SkyTDLine"><input name="paramMap.loginID" type="text" maxlength="20" id="loginID" style="width: 200;" />&nbsp;<font color="red">*</font><span id="loginIDTip" style="width:250px"></span></td>
							</tr>
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine" width="10%">帐号密码：</td>
								<td class="SkyTDLine">
                                  <input name="paramMap.password" type="password" maxlength="15" id="password" style="width: 200;"/>&nbsp;<font color="red">*</font><span id="passwordTip" style="width:250px"></span>
                                       <!-- 密码强度id=密码id+"_style" --><br><span id="password_style" class='testresult'><span class="defaultPass">密码强度</span></span>
                                </td>
							</tr>
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine" width="10%">确认密码：</td>
								<td class="SkyTDLine"><input name="paramMap.confirmPwd" type="password" maxlength="15" id="confirmPwd" style="width: 200;"/>&nbsp;<font color="red">*</font><span id="confirmPwdTip" style="width:250px"></span></td>
							</tr>
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine" width="10%">用户性别：</td>
								<td class="SkyTDLine">&nbsp;<input type="radio" name="paramMap.gender" checked="checked" value="1" />男 &nbsp;<input type="radio" value="0" name="paramMap.gender" />女&nbsp;<span id="genderTip" style="width:250px"></span><font color="red">*</font></td>
							</tr>
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine" width="10%">移动电话：</td>
								<td class="SkyTDLine"><input name="paramMap.mobilePhone" type="text" maxlength="15" id="mobilePhone" style="width: 200;" /><font color="red">*</font><span id="mobilePhoneTip" style="width:250px"></span></td>
							</tr>
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine" width="10%">办公电话：</td>
								<td class="SkyTDLine"><input name="paramMap.officePhone" type="text" maxlength="20" id="officePhone" style="width: 200;" /><font color="red">*</font><span id="officePhoneTip" style="width:250px"></span></td>
							</tr>
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine" width="10%">邮箱地址：</td>
								<td class="SkyTDLine"><input name="paramMap.email" type="text" maxlength="200" id="email" style="width: 200;" /><font color="red">*</font><span id="emailTip" style="width:250px"></span></td>
							</tr>
							<tr class="MeNewTDLine">
								<td align="right" class="SkyTDLine">用户描述：</td>
								<td class="SkyTDLine"><input name="paramMap.description" type="text" maxlength="100" id="description" style="width: 400;" /></td>
							</tr>
							<tr class="MeNewTDLine" align="center">
							<td colSpan="2" class="SkyTDLine">
									<input type="submit" name="BtnOk" value="创建" id="BtnOk" class="SkyButtonBlur" onMouseOut="this.className='SkyButtonBlur'" onMouseOver="this.className='SkyButtonFocus'" />&nbsp;&nbsp;
									<input type="button" name="BtnReturn" value="返回" id="BtnReturn" class="SkyButtonBlur" onMouseOut="this.className='SkyButtonBlur'" onMouseOver="this.className='SkyButtonFocus'" onclick="window.history.back();" /></td>
							</tr>
						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
		<td class="tableCright">&nbsp;</td>
	</tr>
</table>
</form>
</body>
</html>
